﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<%@include file="/common/javascript.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>代课设定</title>
<script type="text/javascript">
    var mainform;
    var viewType = "${viewType}";
    var id = "${id}";
    
    $(function(){
        mainform=$("#mainform");
        mainform.ligerForm();
        //渲染按钮
        LG.setFormDefaultBtn(cancel,viewType=="detail" ? null : save);
    });
    
    function save(){
            LG.submitForm(mainform, function (result) {
            	if(typeof(result)=="string"){
            		result=eval("("+result+")");
            	}
                if (!result.success) {
                    LG.showError('错误:' + result.message);
                }
                else { 
                    LG.showSuccess('保存成功', function () { 
                       LG.callParent("btableList");
                    });
                }
            });
    }
    
    function cancel(){
        var win = window.parent || window;
        if(win.dialog){
        	win.dialog.close();
        }
    }

    
 </script>
</head>

<body>
	<form name="mainform" method="post" id="mainform"
		action="${ctx }/qso/subcourse/save">
		<input type="hidden" name="viewType" value="${viewType}" />
		<input type="hidden" name="id" value="${id}" />
		<table cellpadding="0" cellspacing="0" class="l-table-edit"
			style="width: 90%; margin-top: 10px; margin-left: 15px;">
			<tr>
				<td align="right" class="l-table-edit-td" style="width: 20%">课程名称:</td>
				<td align="left" class="l-table-edit-td" style="width: 30%">${command.couid.title }</td>
				<td align="right" class="l-table-edit-td" style="width: 20%">科系:</td>
				<td align="left" class="l-table-edit-td" style="width: 30%">${command.dptid.title }</td>
			</tr>
			<tr>
				<td align="right" class="l-table-edit-td" style="width: 20%">教室名称:</td>
				<td align="left" class="l-table-edit-td" style="width: 30%">${ command.crmid.crmTitle}</td>
				
				<td align="right" class="l-table-edit-td" style="width: 20%">年级:</td>
				<td align="left" class="l-table-edit-td" style="width: 30%">${command.gradeid.gradeTitle }</td>
			</tr>
			<tr>
				<td align="right" class="l-table-edit-td" style="width: 20%">班级:</td>
				<td align="left" class="l-table-edit-td" style="width: 30%">${command.claid.clsTitle}</td>
				<td align="right" class="l-table-edit-td" style="width: 20%">代课老师:</td>
				<td align="left" class="l-table-edit-td" style="width: 30%"><select
					name="terid" id="terid" ltype="select" validate="{required:true}"
					style="width: 100%">
						<option value="-1">请选择</option>
						<c:forEach items="${teachers}" var="teacher">
							<c:choose>
								<c:when test="${command.teaid.terId eq teacher.terId}">
									<option value="${teacher.terId}" selected="selected">${teacher.terName}</option>
								</c:when>
								<c:otherwise>
									<option value="${teacher.terId}">${teacher.terName}</option>
								</c:otherwise>
							</c:choose>
						</c:forEach>
				</select></td>
			</tr>
		</table>
	</form>
</body>
</html>
